<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>搭建家庭媒体中心 | 小鸟的博客</title><meta name="keywords" content="Markdown,blog"><meta name="author" content="John"><meta name="copyright" content="John"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="搭建家庭媒体中心下载最新的Minidlna镜像docker pull vladgh&#x2F;minidlna 启动容器MiniDLNA (Dockerfile) Image Version Commit License This is MiniDLNA on top of minimal Alpine. It can be configured with environment variables.Usa">
<meta property="og:type" content="article">
<meta property="og:title" content="搭建家庭媒体中心">
<meta property="og:url" content="https://yctxkj.gitee.io/bigbdblog/2020/10/05/008-%E6%90%AD%E5%BB%BA%E5%AE%B6%E5%BA%AD%E5%AA%92%E4%BD%93%E4%B8%AD%E5%BF%83/index.html">
<meta property="og:site_name" content="小鸟的博客">
<meta property="og:description" content="搭建家庭媒体中心下载最新的Minidlna镜像docker pull vladgh&#x2F;minidlna 启动容器MiniDLNA (Dockerfile) Image Version Commit License This is MiniDLNA on top of minimal Alpine. It can be configured with environment variables.Usa">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg">
<meta property="article:published_time" content="2020-10-04T17:53:06.345Z">
<meta property="article:modified_time" content="2020-10-04T17:53:06.397Z">
<meta property="article:author" content="John">
<meta property="article:tag" content="Markdown">
<meta property="article:tag" content="blog">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><link rel="shortcut icon" href="/bigbdblog/img/favicon.ico"><link rel="canonical" href="https://yctxkj.gitee.io/bigbdblog/2020/10/05/008-%E6%90%AD%E5%BB%BA%E5%AE%B6%E5%BA%AD%E5%AA%92%E4%BD%93%E4%B8%AD%E5%BF%83/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/bigbdblog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/bigbdblog/',
  hexoversion: '5.2.0',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  ClickShowText: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isSidebar: true,
  postUpdate: '2020-10-05 01:53:06'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {
  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }

  const autoChangeMode = 'false'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified

    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }
})()</script><meta name="generator" content="Hexo 5.2.0"><link rel="alternate" href="/bigbdblog/atom.xml" title="小鸟的博客" type="application/atom+xml">
</head><body><div id="mobile-sidebar"><div id="menu_mask"></div><div id="mobile-sidebar-menus"><div class="mobile_author_icon"><img class="avatar-img" src="/bigbdblog/null" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="mobile_post_data"><div class="mobile_data_item is-center"><div class="mobile_data_link"><a href="/bigbdblog/archives/"><div class="headline">Articles</div><div class="length_num">32</div></a></div></div><div class="mobile_data_item is-center">      <div class="mobile_data_link"><a href="/bigbdblog/tags/"><div class="headline">Tags</div><div class="length_num">9</div></a></div></div></div><hr/></div></div><div id="body-wrap"><div id="sidebar"><i class="fas fa-arrow-right on" id="toggle-sidebar"></i><div class="sidebar-toc"><div class="sidebar-toc__title">Catalog</div><div class="sidebar-toc__progress"><span class="progress-notice">You've read</span><span class="progress-num">0</span><span class="progress-percentage">%</span><div class="sidebar-toc__progress-bar">     </div></div><div class="sidebar-toc__content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%90%AD%E5%BB%BA%E5%AE%B6%E5%BA%AD%E5%AA%92%E4%BD%93%E4%B8%AD%E5%BF%83"><span class="toc-number">1.</span> <span class="toc-text">搭建家庭媒体中心</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%8B%E8%BD%BD%E6%9C%80%E6%96%B0%E7%9A%84Minidlna%E9%95%9C%E5%83%8F"><span class="toc-number">1.1.</span> <span class="toc-text">下载最新的Minidlna镜像</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8%E5%AE%B9%E5%99%A8"><span class="toc-number">1.2.</span> <span class="toc-text">启动容器</span></a></li></ol></li></ol></div></div></div><header class="post-bg" id="page-header" style="background-image: url(https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/bigbdblog/">小鸟的博客</a></span><span id="menus"><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><div id="post-title"><div class="posttitle">搭建家庭媒体中心</div></div><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-10-04T17:53:06.345Z" title="Created 2020-10-05 01:53:06">2020-10-05</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2020-10-04T17:53:06.397Z" title="Updated 2020-10-05 01:53:06">2020-10-05</time></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">Post View:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout_post" id="content-inner"><article id="post"><div class="post-content" id="article-container"><h1 id="搭建家庭媒体中心"><a href="#搭建家庭媒体中心" class="headerlink" title="搭建家庭媒体中心"></a>搭建家庭媒体中心</h1><h2 id="下载最新的Minidlna镜像"><a href="#下载最新的Minidlna镜像" class="headerlink" title="下载最新的Minidlna镜像"></a>下载最新的Minidlna镜像</h2><p>docker pull vladgh/minidlna</p>
<h2 id="启动容器"><a href="#启动容器" class="headerlink" title="启动容器"></a>启动容器</h2><p>MiniDLNA (Dockerfile)</p>
<p>Image Version Commit License</p>
<p>This is MiniDLNA on top of minimal Alpine. It can be configured with environment variables.<br>Usage</p>
<p>Prefix any configuration directive of MiniDLNA with MINIDLNA_ and run your container:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">docker run -d \</span><br><span class="line">  --net&#x3D;host \</span><br><span class="line">  -v &lt;media dir on host&gt;:&#x2F;media \</span><br><span class="line">  -e MINIDLNA_MEDIA_DIR&#x3D;&#x2F;media \</span><br><span class="line">  -e MINIDLNA_FRIENDLY_NAME&#x3D;MyMini \</span><br><span class="line">  vladgh&#x2F;minidlna</span><br></pre></td></tr></table></figure>

<p>Note: You need to run the container in host mode for it to be able to receive UPnP broadcast packets. The default bridge mode will not work.<br>Multiple Media dirs</p>
<p>Any environment variable starting with MINIDLNA_MEDIA_DIR will be treated as an additional media_dir directive and any suffix in the variable name will be trimmed (ex: MINIDLNA_MEDIA_DIR_1). This way you can declare multiple media_dir directives</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">docker run -d \</span><br><span class="line">  --net&#x3D;host \</span><br><span class="line">  -v &lt;media dir on host&gt;:&#x2F;media&#x2F;audio \</span><br><span class="line">  -v &lt;media dir on host&gt;:&#x2F;media&#x2F;video \</span><br><span class="line">  -e MINIDLNA_MEDIA_DIR_1&#x3D;A,&#x2F;media&#x2F;audio \</span><br><span class="line">  -e MINIDLNA_MEDIA_DIR_2&#x3D;V,&#x2F;media&#x2F;video \</span><br><span class="line">  -e MINIDLNA_FRIENDLY_NAME&#x3D;MyMini \</span><br><span class="line">  vladgh&#x2F;minidlna</span><br></pre></td></tr></table></figure>

<p>See: <a target="_blank" rel="noopener" href="http://manpages.ubuntu.com/manpages/raring/man5/minidlna.conf.5.html">http://manpages.ubuntu.com/manpages/raring/man5/minidlna.conf.5.html</a></p>
</div><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">Author: </span><span class="post-copyright-info"><a href="mailto:undefined">John</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">Link: </span><span class="post-copyright-info"><a href="https://yctxkj.gitee.io/bigbdblog/2020/10/05/008-%E6%90%AD%E5%BB%BA%E5%AE%B6%E5%BA%AD%E5%AA%92%E4%BD%93%E4%B8%AD%E5%BF%83/">https://yctxkj.gitee.io/bigbdblog/2020/10/05/008-%E6%90%AD%E5%BB%BA%E5%AE%B6%E5%BA%AD%E5%AA%92%E4%BD%93%E4%B8%AD%E5%BF%83/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">Copyright Notice: </span><span class="post-copyright-info">All articles in this blog are licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> unless stating additionally.</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/bigbdblog/tags/Markdown/">Markdown</a><a class="post-meta__tags" href="/bigbdblog/tags/blog/">blog</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/bigbdblog/2020/10/05/009-%E6%9C%88%E5%BA%A6%E8%80%83%E5%8B%A4%E7%BB%9F%E8%AE%A1SQL%E8%84%9A%E6%9C%AC/"><img class="prev-cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="onerror=null;src='/bigbdblog/img/404.jpg'"><div class="pagination-info"><div class="label">Previous Post</div><div class="prev_info">月度考勤统计SQL脚本</div></div></a></div><div class="next-post pull-right"><a href="/bigbdblog/2020/10/05/007-Docker%E7%AE%80%E6%98%93%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/"><img class="next-cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="onerror=null;src='/bigbdblog/img/404.jpg'"><div class="pagination-info"><div class="label">Next Post</div><div class="next_info">Docker简易使用教程</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> Related Articles</span></div><div class="relatedPosts-list"><div><a href="/bigbdblog/2020/10/05/002-使用docker构建vim-golang开发环境/" title="使用docker构建vim-golang开发环境"><img class="cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-05</div><div class="title">使用docker构建vim-golang开发环境</div></div></a></div><div><a href="/bigbdblog/2020/10/05/003-Docker运行图形界面程序/" title="003-Docker运行图形界面程序.md"><img class="cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-05</div><div class="title">003-Docker运行图形界面程序.md</div></div></a></div><div><a href="/bigbdblog/2020/10/05/004-构建基于Git的知识管理体系/" title="构建基于Git的知识管理体系"><img class="cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-05</div><div class="title">构建基于Git的知识管理体系</div></div></a></div><div><a href="/bigbdblog/2020/10/05/005-高标准做事/" title="高标准做事"><img class="cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-05</div><div class="title">高标准做事</div></div></a></div><div><a href="/bigbdblog/2020/10/05/006-MTP培训笔记读后感/" title="2019年MTP管理技能培训笔记-读后感"><img class="cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-05</div><div class="title">2019年MTP管理技能培训笔记-读后感</div></div></a></div><div><a href="/bigbdblog/2020/10/05/007-Docker简易使用教程/" title="Docker简易使用教程"><img class="cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-05</div><div class="title">Docker简易使用教程</div></div></a></div></div></div></article></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 By John</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><section id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="Read Mode"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog"></i></button><button class="close" id="mobile-toc-button" type="button" title="Table Of Contents"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></section><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/bigbdblog/js/utils.js"></script><script src="/bigbdblog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><div class="js-pjax"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></div></body></html>